package top.chenyaohua.service;

import top.chenyaohua.annotion.Repository;
import top.chenyaohua.beans.User;

import java.util.List;

@Repository
public interface UserDao {
    /**
     * <code>
     *     <select id="findAll">
     *          select name,password from tuser;
     *     </select>
     * </code>
     * @param name
     * @return
     */
    User findAll(String name);

    /**
     * <code>
     *     <delete id="remove">
     *      delete from tuser where id =#{id}
     *     </delete>
     * </code>
     * @param id
     * @return
     */
    User remove(String id);

    /**
     * <code>
     *     <update id="update" resulteType="int">
     *         update tuser set password = null
     *         <where>
     *             <for item="it" open=" id in (" close=")" separate=",">
     *                 #{it}
     *             </for>
     *         </where>
     *     </update>
     * </code>
     * @param list
     * @return
     */
    int update(List<String> list);
}
